describe 'build'
  	before_each
  	  	build_json = json_fixture("success_build.json");
  	  	build = new Build(build_json);
  	end
  	
  	it 'should tell the build date'
  	   	build_date = build.getDate();
  	  	build_date.should.be("2011-11-08");
  	end
  	
  	it 'should tell the submitter name'
  	  	submitter_name = build.getSubmitter();
  	  	submitter_name.should.be("bushiy");
  	end

	it 'should tell the job url'
		job_url = build.getJobUrl();
		job_url.should.be("http://135.251.238.250:8080/view/TLA3.0/view/TLA3.0-CALLP/job/CALLP_CR_MERGE_TEST/");
	end
  	
  	it 'should not throw exception when the build has no changeset'
  		build_withno_changeset = new Build(json_fixture('build_withno_changeset.json'));
  		build_withno_changeset.getSubmitter().should.equal("unknown");
  	end
  	
  	describe 'build status'
		it 'should tell building given is building'
			build = new Build(json_fixture('building_build.json'))
			build.getStatus().should.be("building");
		end
		
		it 'should tell success given build success'
			build = new Build(json_fixture("success_build.json"));
			build.getStatus().should.be("success");
		end
		
		it 'successful build is not building'
			build = new Build(json_fixture("failure_build.json"));
			build.getStatus().should.be("failure");
		end
	end
end
